<?=$system_message;?>
<div class="row">
	<div class="btn-group">
		<a href="<?=site_url('');?>" class="btn btn-success btn-small">Exit</a>
		<a href="<?=site_url('calendar/school/'.$current_year.'/'.$current_month);?>" class="btn btn-small  btn-inverse">School Calendar</a>
		<a href="<?=site_url('calendar/section/'.$current_year.'/'.$current_month);?>" class="btn btn-small">Section Calendar</a>
		<a href="<?=site_url('calendar/academic/'.$current_year.'/'.$current_month);?>" class="btn btn-small">Academic Calendar</a>
	</div>
	<a href="#" data-reveal-id="myModal" class="btn btn-primary"><i class="icon-plus"></i>&nbsp;Add Event</a>
	<hr class="clearfix">

	<div class="row">
		<div class="large-6 columns">
		<div class="large-7 columns">
			<?=form_dropdown('name', $months,$current_month,'class="redirect-auto-calendar-month" data-url="'.$plink.'" data-add="'.$current_year.'"');?>
		</div>
		<div class="large-5 columns">
			<?=form_dropdown('name', $years,$current_year,'class="redirect-auto-calendar-year" data-url="'.$plink.'" data-add="'.$current_month.'"');?>
		</div>
		</div>
	</div>
</div>
<!-- SHOW THE CALENDAR -->
<?=$calendar;?>
<!-- MODAL FOR ADDING NEW CALENDAR EVENT -->
<div id="myModal" class="reveal-modal">
  <h2>Add New Event</h2>
  	<form action="<?=site_url('calendar/school/'.$current_year.'/'.$current_month);?>" method="POST">
	<div class="row">
		<div class="large-6 columns">
			<label class="label label-info">Start of Event</label>
			<input type="text" name="evt_str" class="datepicker3">
		</div>
		<div class="large-6 columns">
			<label class="label label-info">End Of Event</label>
			<input type="text" name="evt_end" class="datepicker3">
		</div>
	</div>

	<div class="row">
		<div class="large-6 columns">
			<label class="label label-info">Name of Event</label>
			<input type="text" name="evt_nme">
		</div>
		<div class="large-6 columns">
			<label class="label label-info">Description/other message</label>
			<textarea name="evt_desc"></textarea>
		</div>
	</div>

	<div class="row">
		<div class="large-12 columns">
			<label class="label label-info">Color</label>
			<br>
			<span style="display:inline-block;padding:5px;"><input type="radio" name="evt_col" value="" checked>&nbsp;<a href="#" class="btn btn-mini">Default Color</a></span>
			<span style="display:inline-block;padding:5px;"><input type="radio" name="evt_col" value="btn-primary">&nbsp;<a href="#" class="btn btn-mini btn-primary">Color 1</a></span>
			<span style="display:inline-block;padding:5px;"><input type="radio" name="evt_col" value="btn-info">&nbsp;<a href="#" class="btn btn-mini btn-info">color 2</a></span>
			<span style="display:inline-block;padding:5px;"><input type="radio" name="evt_col" value="btn-success">&nbsp;<a href="#" class="btn btn-mini btn-success">color 3</a></span>
			<span style="display:inline-block;padding:5px;"><input type="radio" name="evt_col" value="btn-warning">&nbsp;<a href="#" class="btn btn-mini btn-warning">color 4</a></span>
			<span style="display:inline-block;padding:5px;"><input type="radio" name="evt_col" value="btn-danger">&nbsp;<a href="#" class="btn btn-mini btn-danger">color 5</a></span>
			<span style="display:inline-block;padding:5px;"><input type="radio" name="evt_col" value="btn-inverse">&nbsp;<a href="#" class="btn btn-mini btn-inverse">color 6</a></span>
		</div>
	</div>

	<hr>
	<input type="submit" name="add_new_evt_for_school_cal" class="btn btn-primary" value="Add New Event">
	<a href="#" id="close-reveal-modal" class="btn">Close</a>
	</form>
  	<a class="close-reveal-modal">&#215;</a>
</div>
<script src="<?=script_url('custom/calendarautoredirect');?>"></script>
<script>
$(document).on('click','#close-reveal-modal',function(e){
 e.preventDefault();
 $('#myModal').foundation('reveal', 'close');
});
</script>